<?php
require_once '../function/connection.php';

include '../view/user_panel.php';
connection();

$iId = $_GET['id'];
$query = "SELECT * from `rezerwacje` where `rez_1_id` = '$iId' ";
$result = mysql_query($query);

for ($i = 0; $i < mysql_num_rows($result); $i++) {
    $aReservations = mysql_fetch_assoc($result);

    $sHtml =
            "<div class='container'> 
     <table class='table table-striped table-bordered table-condensed'>
     
     <tr><td>Data</td><td>Godzina</td><td>Opis</td><td>Status</td></tr>
     <tr><td>" . $aReservations['rez_data'] . "</td><td>" . $aReservations['rez_godzina'] . "</td><td>" . $aReservations['rez_opis'] . "</td><td>" . $aReservations['rez_status'] . "</td>
         
         

</tr>
       </table>";
}




echo $sHtml;
?>

<form action="/function/change_reservation_status.php?" method="post" enctype="multipart/form-data" >

    <select style="margin-bottom: 0;" name="status" id="reservation-status">
        <option value="zaakceptowane">zaakceptuj</option>
        <option value="odzucone">odrzuć</option>
    </select>    
    <input type='hidden' name="id" value="<?php echo $iId ?>">
    <input class="btn" type="submit" value="Zmień status">
</form>
</div>
<?php
include '../view/footer.php';
?>
